package com.application.Menu;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.application.R;
import util.core.Periodic;

public class MainMenu extends Activity {


    private View.OnClickListener mainListener = new View.OnClickListener() {
        public void onClick(View view) {
            int id = view.getId();
            if (id == R.id.goto_tools) {
                Intent intent = new Intent(MainMenu.this, ToolsMenu.class);
                startActivity(intent);
            } else if(id == R.id.goto_about) {
                Toast a = Toast.makeText(getApplicationContext(), "Created by Andrew Zeng and Kevin Baik", Toast.LENGTH_LONG);
                a.setDuration(20);
                a.show();
            }
        }
    };

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initMain();
    }

    private void initMain() {
        setContentView(R.layout.main_layout);
        findViewById(R.id.goto_tools).setOnClickListener(mainListener);
        findViewById(R.id.goto_about).setOnClickListener(mainListener);
        Periodic.initialize(getApplicationContext());
    }
}
